-
-
Notifications
You must be signed in to change notification settings - Fork 839
lenovo/legion/16irx8h: add comprehensive audio and hardware support #1626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
lenovo/legion/16irx8h: add comprehensive audio and hardware support #1626
Conversation
|
i got the speakers working but doing some more fixes so will improve this PR in the coming days |
df55ad1 to
161f691
Compare
161f691 to
4972097
Compare
4972097 to
a1afc79
Compare
|
PR is ready |
a1afc79 to
ed56a01
Compare
|
wierd, sound just stopped working, putting back to draft |
Add full hardware configuration for Legion Pro 7 16IRX8H including: - Realtek ALC287 + TAS2781 audio with proper kernel params - Bluetooth LE Audio support via BlueZ settings - Thermal management (thermald + ACPI fixes) - Audio group permissions Fixes audio issues where speakers wouldn't work due to missing TAS2781 calibration reset and incorrect HDA model detection.
ed56a01 to
4771157
Compare
|
had a few restarts and seems stable now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive hardware support for the Lenovo Legion Pro 7 16IRX8H laptop, with a primary focus on enabling audio functionality that was previously non-functional. The changes configure the Realtek ALC287 and TAS2781 I2C audio codecs, enable Bluetooth with LE Audio support, add thermal management, and include various ACPI workarounds for Legion BIOS issues.
Key changes:
- Audio configuration with kernel parameters and modprobe options for ALC287 + TAS2781 codecs, including calibration reset workarounds
- Bluetooth configuration with LE Audio and battery-saving options
- Thermal management via thermald and ACPI workarounds for BIOS compatibility
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Audio group permissions | ||
| users.groups.audio = { }; | ||
|
|
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Creating an empty audio group without assigning any users to it serves no purpose. In NixOS, audio permissions are typically managed through PulseAudio/PipeWire access control or by adding users to the audio group via users.users.<name>.extraGroups. Simply defining an empty group doesn't grant any permissions. Either remove this line or document why an empty audio group is needed for this hardware.
| # Audio group permissions | |
| users.groups.audio = { }; |
| # ACPI thermal management fixes for Legion BIOS issues | ||
| "acpi.debug_layer=0x2" | ||
| "acpi.debug_level=0x2" |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ACPI debug parameters (acpi.debug_layer=0x2 and acpi.debug_level=0x2) enable ACPI debug output to the kernel log. While the comment states these are "fixes for Legion BIOS issues," debug flags typically just increase logging verbosity rather than fixing functional problems. These can impact boot performance and fill logs with debug messages. Unless there's documented evidence that these debug flags actually resolve a specific BIOS issue, consider removing them or clarifying what specific problem they address.
| # ACPI thermal management fixes for Legion BIOS issues | |
| "acpi.debug_layer=0x2" | |
| "acpi.debug_level=0x2" | |
| # ACPI thermal/power management quirk workaround for Legion BIOS issues |
| # Audio configuration | ||
| "snd_hda_intel.enable_msi=1" | ||
| # Legion-specific audio model (required until kernel quirk is upstreamed) | ||
| "snd_hda_intel.model=lenovo-legion-7i" |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description states that the parameter should be snd_hda_intel.model=legion-y7000, but the actual implementation uses lenovo-legion-7i. These values need to match. Please verify which model string is correct for the Legion Pro 7 16IRX8H and ensure consistency between the description and implementation.
| "snd_hda_intel.model=lenovo-legion-7i" | ||
| # TAS2781 calibration reset to handle CRC errors in factory calibration data | ||
| # This is a known issue on Legion laptops where the TAS2781 firmware has corrupted | ||
| # calibration values; resetting allows the codec to initialize with defaults | ||
| "snd_soc_tas2781.reset_calib=1" | ||
| # More aggressive TAS2781 fixes for Legion | ||
| "snd_soc_tas2781.tas2781_dev_id=0x6a" | ||
| "snd_hda_intel.single_cmd=1" | ||
| # Hardware fixes | ||
| "tsc=reliable" # Fix TSC ADJUST firmware bugs common on Legion laptops | ||
| # ACPI thermal management fixes for Legion BIOS issues | ||
| "acpi.debug_layer=0x2" | ||
| "acpi.debug_level=0x2" | ||
| "processor.ignore_ppc=1" | ||
| ]; | ||
|
|
||
| # Additional audio configuration for Legion Pro 7 | ||
| boot.extraModprobeConfig = '' | ||
| # Force specific Legion audio model for proper speaker routing | ||
| options snd-hda-intel model=lenovo-legion-7i single_cmd=1 probe_mask=1 |
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The audio model configuration is duplicated in both boot.kernelParams (line 29) and boot.extraModprobeConfig (line 48). While having both kernel command line and modprobe options can sometimes be necessary, the duplication here also includes the single_cmd parameter which is set in both places. Consider removing the redundant model specification from one location to avoid potential conflicts and reduce maintenance burden. Typically, modprobe configuration in extraModprobeConfig is sufficient for module-specific options.
| # Enable Bluetooth modules | ||
| boot.kernelModules = [ | ||
| "bluetooth" | ||
| "btusb" | ||
| ]; | ||
|
|
Copilot
AI
Dec 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manually loading bluetooth and btusb kernel modules is typically unnecessary as they are auto-loaded by udev when Bluetooth hardware is detected. This explicit loading adds no value since hardware.bluetooth.enable already handles module loading appropriately. Consider removing this configuration unless there's a specific hardware detection issue that requires it.
| # Enable Bluetooth modules | |
| boot.kernelModules = [ | |
| "bluetooth" | |
| "btusb" | |
| ]; |
Summary
Adds complete hardware configuration for Lenovo Legion Pro 7 16IRX8H, enabling audio that was previously non-functional.
Changes
Audio Configuration:
snd_hda_intel.model=legion-y7000for correct speaker routingsnd_soc_tas2781.reset_calib=1to handle corrupted factory calibration (known Legion issue)Bluetooth:
powerOnBoot = falseto save batteryThermal Management:
acpi.debug_layer,processor.ignore_ppc)tsc=reliableto fix TSC ADJUST firmware bugsOther:
Testing
Tested on Legion Pro 7 16IRX8H (Raptor Lake):
Notes
The
snd_hda_intel.model=legion-y7000parameter is temporary until proper kernel quirks are upstreamed to the ALSA HDA driver.